-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unconditionally capture tokens for attributes. #77255
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 621463923b669eb8e70c465bffa8eab63bb55b74 with merge 01460526ba12973fff687fd5d0771741d6dec0d0... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 01460526ba12973fff687fd5d0771741d6dec0d0 with parent 1ec980d, future comparison URL. |
Blocked on #77250. |
Finished benchmarking try commit (01460526ba12973fff687fd5d0771741d6dec0d0): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
A lot of the slowdown is probably due to #77250 |
#77250 has landed. |
6214639
to
25149b8
Compare
This allows us to avoid synthesizing tokens in `prepend_attr`, since we have the original tokens available. We still need to synthesize tokens when expanding `cfg_attr`, but this is an unavoidable consequence of the syntax of `cfg_attr` - the user does not supply the `#` and `[]` tokens that a `cfg_attr` expands to.
25149b8
to
37b25e8
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 37b25e8 with merge c2017a52dcd6c36ff6aacd9632eed4b96f7440aa... |
☀️ Try build successful - checks-actions, checks-azure |
Queued c2017a52dcd6c36ff6aacd9632eed4b96f7440aa with parent 1eaadeb, future comparison URL. |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 5c7d8d0 with merge 67a0ba996f5e1d8ba58854397300e83feaf43de2... |
@rust-timer build 67a0ba996f5e1d8ba58854397300e83feaf43de2 |
Queued 67a0ba996f5e1d8ba58854397300e83feaf43de2 with parent a9cd294, future comparison URL. |
cc @rust-lang/infra The try build completed, but Bors never left a comment. |
💥 Test timed out |
Finished benchmarking try commit (67a0ba996f5e1d8ba58854397300e83feaf43de2): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
The performance impact is now less than 0.5% @petrochenkov: This is now ready for review |
@bors r+ |
📌 Commit 5c7d8d0 has been approved by |
☀️ Test successful - checks-actions |
Fixes rust-lang#78398 I forgot to handle this case in rust-lang#77255
…, r=oli-obk Remove tokens from foreign items in `TokenStripper` Fixes rust-lang#78398 I forgot to handle this case in rust-lang#77255
This allows us to avoid synthesizing tokens in
prepend_attr
, since wehave the original tokens available.
We still need to synthesize tokens when expanding
cfg_attr
,but this is an unavoidable consequence of the syntax of
cfg_attr
-the user does not supply the
#
and[]
tokens that acfg_attr
expands to.
This is based on PR #77250 - this PR exposes a bug in the current
collect_tokens
implementation, which is fixed by the rewrite.